#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
	int i, m, count;
	while ((scanf("%d", &i) != EOF))
	{
		count = 0;
		m = 1;
		do
		{
			if ((i& m)>= 1)       
			{
				count++;   
			}
			m =m<< 1;
		} while (i >= m);
		printf("%d\n", count);
	}
	return 0;
}